/*     */ package com.cr.quartz.controller;
/*     */ 
/*     */ import com.cr.common.annotation.Log;
/*     */ import com.cr.common.core.controller.BaseController;
/*     */ import com.cr.common.core.domain.AjaxResult;
/*     */ import com.cr.common.core.page.TableDataInfo;
/*     */ import com.cr.common.enums.BusinessType;
/*     */ import com.cr.common.utils.MyStringUtils;
/*     */ import com.cr.common.utils.poi.ExcelUtil;
/*     */ import com.cr.quartz.domain.SysJob;
/*     */ import com.cr.quartz.domain.SysJobLog;
/*     */ import com.cr.quartz.service.ISysJobLogService;
/*     */ import com.cr.quartz.service.ISysJobService;
/*     */ import java.util.List;
/*     */ import org.apache.shiro.authz.annotation.RequiresPermissions;
/*     */ import org.springframework.beans.factory.annotation.Autowired;
/*     */ import org.springframework.stereotype.Controller;
/*     */ import org.springframework.ui.ModelMap;
/*     */ import org.springframework.web.bind.annotation.GetMapping;
/*     */ import org.springframework.web.bind.annotation.PathVariable;
/*     */ import org.springframework.web.bind.annotation.PostMapping;
/*     */ import org.springframework.web.bind.annotation.RequestMapping;
/*     */ import org.springframework.web.bind.annotation.RequestParam;
/*     */ import org.springframework.web.bind.annotation.ResponseBody;
/*     */ 
/*     */ @Controller
/*     */ @RequestMapping({"/monitor/jobLog"})
/*     */ public class SysJobLogController extends BaseController {
/*  35 */   private String prefix = "monitor/job";
/*     */   
/*     */   @Autowired
/*     */   private ISysJobService jobService;
/*     */   
/*     */   @Autowired
/*     */   private ISysJobLogService jobLogService;
/*     */   
/*     */   @RequiresPermissions({"monitor:job:view"})
/*     */   @GetMapping
/*     */   public String jobLog(@RequestParam(value = "jobId", required = false) Long jobId, ModelMap mmap) {
/*  47 */     if (MyStringUtils.isNotNull(jobId)) {
/*  49 */       SysJob job = this.jobService.selectJobById(jobId);
/*  50 */       mmap.put("job", job);
/*     */     } 
/*  52 */     return this.prefix + "/jobLog";
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"monitor:job:list"})
/*     */   @PostMapping({"/list"})
/*     */   @ResponseBody
/*     */   public TableDataInfo list(SysJobLog jobLog) {
/*  60 */     startPage();
/*  61 */     List<SysJobLog> list = this.jobLogService.selectJobLogList(jobLog);
/*  62 */     return getDataTable(list);
/*     */   }
/*     */   
/*     */   @Log(title = "调度日志", businessType = BusinessType.EXPORT)
/*     */   @RequiresPermissions({"monitor:job:export"})
/*     */   @PostMapping({"/export"})
/*     */   @ResponseBody
/*     */   public AjaxResult export(SysJobLog jobLog) {
/*  71 */     List<SysJobLog> list = this.jobLogService.selectJobLogList(jobLog);
/*  72 */     ExcelUtil<SysJobLog> util = new ExcelUtil(SysJobLog.class);
/*  73 */     return util.exportExcel(list, "调度日志");
/*     */   }
/*     */   
/*     */   @Log(title = "调度日志", businessType = BusinessType.DELETE)
/*     */   @RequiresPermissions({"monitor:job:remove"})
/*     */   @PostMapping({"/remove"})
/*     */   @ResponseBody
/*     */   public AjaxResult remove(String ids) {
/*  82 */     return toAjax(this.jobLogService.deleteJobLogByIds(ids));
/*     */   }
/*     */   
/*     */   @RequiresPermissions({"monitor:job:detail"})
/*     */   @GetMapping({"/detail/{jobLogId}"})
/*     */   public String detail(@PathVariable("jobLogId") Long jobLogId, ModelMap mmap) {
/*  89 */     mmap.put("name", "jobLog");
/*  90 */     mmap.put("jobLog", this.jobLogService.selectJobLogById(jobLogId));
/*  91 */     return this.prefix + "/detail";
/*     */   }
/*     */   
/*     */   @Log(title = "调度日志", businessType = BusinessType.CLEAN)
/*     */   @RequiresPermissions({"monitor:job:remove"})
/*     */   @PostMapping({"/clean"})
/*     */   @ResponseBody
/*     */   public AjaxResult clean() {
/* 100 */     this.jobLogService.cleanJobLog();
/* 101 */     return success();
/*     */   }
/*     */ }


/* Location:              D:\tmp\creditorRights-admin\BOOT-INF\lib\creditorRights-quartz-4.7.0.jar!\com\cr\quartz\controller\SysJobLogController.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */